import Cookies from 'js-cookie'

const app = {
    state: {
      sidebar: {
        opened: !+Cookies.get("sidebarStatus"),
        withoutAnimation: false
      },
      listReq: {
        $size: 30,
        $page: 1
      },
      pageSizeArr: [10, 30, 100, 200, 500, 1000],
      qiniuUrl: 'http://opimg.yiwanshu.com',
      problemsTypeList: [],
      temp_type: {2: '公用模板', 1: '个人模板'},
      pro_list: null,
      statusList: [
        {id: 0, text: '未处理'},
        {id: 1, text: '已处理'}
      ],
      withDrawProblemType:[
        {val: 201, lab: '提现未到账'},
        {val: 203, lab: '提现未到账-撸羊毛'},
        {val: 204, lab: '提现未到账-恶意套利'},
        {val: 205, lab: '提现未到账-审核中'},
        {val: 206, lab: '提现未到账-到账延迟'},
        {val: 207, lab: '提现未到账-系统异常'},
        {val: 202, lab: '其他问题'}
      ],
      accountProblemType:[
        {val: 301, lab: '无法注册'},
        {val: 302, lab: '异常登录'},
        {val: 303, lab: '保险柜问题'},
        {val: 304, lab: '无法接收验证码'},
        {val: 305, lab: '其他问题'}
      ],
      gameProblemType:[
        {val: 401, lab: '掉线'},
        {val: 402, lab: '闪退'},
        {val: 403, lab: '自动弃牌'},
        {val: 404, lab: '结算未派奖'},
        {val: 405, lab: '点击操作按钮无反应'},
        {val: 406, lab: '游戏卡住无法退出'},
        {val: 407, lab: '其他问题'}
      ],
      gameProblemNextType:[
        {val: 1, lab: '捕鱼'},
        {val: 2, lab: '斗地主'},
        {val: 3, lab: '龙虎斗'},
        {val: 4, lab: '水浒传'},
        {val: 5, lab: '炸金花'},
        {val: 6, lab: '金鲨银鲨'},
        {val: 7, lab: '血拼牛牛'},
        {val: 8, lab: '百人牛牛'},
        {val: 9, lab: '红黑大战'},
        {val: 10, lab: '抢庄牛牛'}
      ],
      otherProblemType:[
        {val: 601, lab: '问题'},
        {val: 602, lab: '建议'},
        {val: 603, lab: '活动相关'},
        {val: 604, lab: '输钱抱怨'}
      ],
      questionType: {
        201: '提现未到账',
        202: '其他问题',
        203: '提现未到账-撸羊毛',
        204: '提现未到账-恶意套利',
        205: '提现未到账-审核中',
        206: '提现未到账-到账延迟',
        207: '提现未到账-系统异常',
        301: '无法注册',
        302: '异常登录',
        303: '保险柜问题',
        304: '无法接收验证码',
        305: '其他问题',
        401: '掉线',
        402: '闪退',
        403: '自动弃牌',
        404: '结算未派奖',
        405: '点击操作按钮无反应',
        406: '游戏卡住无法退出',
        407: '其他问题',
        601: '问题',
        602: '建议',
        603: '活动相关',
        604: '输钱抱怨'
      },
      gameType: {
        1: '捕鱼',
        2: '斗地主',
        3: '龙虎斗',
        4: '水浒传',
        5: '炸金花',
        6: '金鲨银鲨',
        7: '血拼牛牛',
        8: '百人牛牛',
        9: '红黑大战',
        10: '抢庄牛牛'
      },
      contactType: {
        1: '微信',
        2: 'QQ',
        3: '手机号'
      },
      contactType_: [
        {
          value:1,
          text: "微信",
        },{
          value:2,
          text: "QQ",
        },{
          value:3,
          text: "手机号",
        }],
      pay_type: {
        88: "云闪付",
        101: "支付宝自助充值",
        102: "银行卡自助充值",
        103: "微信自助充值",
        1000: "JustPay微信",
        1001: "JustPay支付宝",
        1002: "JustPay银联",
        1012: "JustPay QQ钱包",
        1013: "Hydra支付宝",
        1003: "代理充值",
        1019: "点卡支付",
        1111: "JustPay测试",
        1201: "线下银行卡转账",
        1202: "定额支付宝",
        1203: "定额微信",
        1204: '原生微信',
        1205: '官方代理充值',
        1206: '支付宝扫码',
        1207: 'Hydra支付宝',
        1208: '定额Hydra支付宝',
        4888: '官方秒付',
      },
      proSubordinateTeamNum_:{
        0:"无",
        1:"0-50",
        2:"51-200",
        3:"201-500",
        4:"500+",
      },
      propNewUser_:{
        1:"0-50",
        2:"51-200",
        3:"201-500",
        4:"501-1000",
        5:"1000+",
      },
      AppealType: {1: 'JustPay', 2: 'UnionAgency', 3: 'MiaoPay'}
    },
    mutations: {
      TOGGLE_SIDEBAR: state => {
        if (state.sidebar.opened) {
          Cookies.set("sidebarStatus", 1);
        } else {
          Cookies.set("sidebarStatus", 0);
        }
        state.sidebar.opened = !state.sidebar.opened;
      },
      SET_PROBLEMS_TYPE_LIST(list) {
        this.problemsTypeList = list
      }
      ,
      SET_PRO_LIST(state, list) {
        state.pro_list = list
        localStorage.setItem('pro_list', JSON.stringify(list))
      }
    },
    actions: {
      ToggleSideBar: ({commit}) => {
        commit("TOGGLE_SIDEBAR");
      },
      SetProblemTypeList:
        ({commit}) => {
          commit('SET_PROBLEMS_TYPE_LIST')
        },
      setProList:
        ({commit}, list) => {
          commit('SET_PRO_LIST', list)
        }
    }
  }
;

export default app
